
function getStorageData(key) {
	let value;
	try{
		const data = uni.getStorageSync(key)
		if (data) {
			value = data
		}
	} catch (e){
		console.log(e);
	}
	return value
}

function setStorageData(key, data) {
	return new Promise ((resolve, reject) =>{
		uni.setStorage({
			key: key,
			data: data,
			success: () => {
				resolve("success")
			},
			fail: (err) => {
				reject(err)
			}
		})
	})
}

export default{
	getStorageData,
	setStorageData
}